package chapter12

/**
  * @Copyright: Shanghai Definesys Company.All rights reserved.
  * @Description:
  * @author: chuhaitao
  * @since: 2019/1/18 22:14
  * @history:
  *          1.2019/1/18 created by chuhaitao
  */
object MatchListDemo {

  def main(args: Array[String]): Unit = {

    for (list<-Array(List(0),List(0,12,3),List(0,1),List(1,8))){

      var result= list match {
        case 0::Nil=>0
        case x::y::Nil=>x +"->" +y
        case 0::tail=>0+"..."

      }
      println(result)
    }




  }

}
